package com.controller.manage;

import java.util.List;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.controller.vo.PolicyInfoVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;


import com.service.policyidservice.Policyservice;

@Controller
public class ManageController {
       @Autowired
       private Policyservice policyservice;
       
	
	
	
	
	    // 报案信息页面显示
		@RequestMapping("baoan.html")
		public String baoan() {

			return "baoan";

		}
		
		
		
		
		
		
		// 保险人信息页面显示
		@RequestMapping("manage_member_xh.html")
		public String manage_member_xh(Model model) {

			return "manage_member_xh";

		}
		
		// 报案资料信息页面显示
		@RequestMapping("manage_ziliao_xh.html")
		public String manage_ziliao_xh() {

			return "manage_ziliao_xh";

		}

		// 车辆定损信息页面显示
		@RequestMapping("carloss_xh.html")
		public String carloss_xh() {

			return "carloss_xh";

		}
		
	    //获取保单信息
		//使用VO类的Controller
		@ResponseBody
		@RequestMapping(value = "manage_member_xh.do", produces = { "application/json;charset=utf-8" })
		public String getList(Integer pageNo,String insuredname){
			PageHelper.startPage(pageNo,5);
			
			List<PolicyInfoVo> list = policyservice.getPolicyInfoVoList(insuredname);
			
			PageInfo<PolicyInfoVo> page = new PageInfo<PolicyInfoVo>(list);
			
			return JSON.toJSONString(page);
		};
		
		
		// 保险人信息副本页面显示
		@RequestMapping("menber_list_b.html")
		public String menber_list_b(String id,Model model) {
            System.out.println(id);
            
            
			
			return "menber_list_b";

		}
		
		
		
		
}
